//获取应用实例
const app = getApp()

Page({
  data: {
    title:"",
    content:"",
  },
  onLoad:function(){
    var that=this;
  },
  onShareAppMessage: function () {
    var that = this;
    return {
      title: that.data.title,
      path: '/pages/index/index'
    }
  },
  Title: function (e) {
    this.setData({
      title:e.detail.value,
    })
   },
  Content: function (e) {
    this.setData({
      content: e.detail.value,
    })
   },
  Reply:function(){
    var title = this.data.title;
    var content = this.data.content;
    if(title == ""){
      wx.showToast({
        title: '请填写标题',
        icon: "none",
        duration: 2000,
      })
      return ;
    }
    if ( content == ""){
      wx.showToast({
        title: '请填写内容',
        icon: "none",
        duration: 2000,
      })
      return;
    }
    wx.request({
      url: '',
      data: {
        "title": title,
        "content": content,
      },
    })
  },
})
